package org.zjz

import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.scala.{DefaultScalaModule, ScalaObjectMapper}
import org.apache.poi.xwpf.usermodel.XWPFDocument
import org.zjz.fun.{BattBean, BattIteratorAnalysis}
import org.zjz.fun.batWord.{PreconditionFun, WordFun}
import org.zjz.BatUtils._
import org.zjz.fun.BattIteratorAnalysis.SimplePackage

import scala.collection.mutable.ListBuffer

object main {

  def main(args: Array[String]): Unit = {
    var json =
      """{
        |  "data": [
        |    {
        |      "title": "赵军舟",
        |      "titleType": "TEXT",
        |      "child": [
        |        {
        |          "title": "赵军舟1",
        |          "titleType": "TEXT",
        |          "child": [
        |            {
        |              "title": "赵军舟4",
        |              "titleType": "TEXT",
        |              "child": [
        |                {
        |                  "title": "赵军舟4",
        |                  "titleType": "TEXT",
        |                  "child": []
        |                },
        |                {
        |                  "title": "赵军舟5",
        |                  "titleType": "TEXT",
        |                  "child": []
        |                }]
        |            },
        |            {
        |              "title": "赵军舟5",
        |              "titleType": "TEXT",
        |              "child": []
        |            }]
        |        }
        |      ]
        |    },
        |    {
        |      "title": "工作经历",
        |      "titleType": "TEXT",
        |      "child": []
        |    },
        |    {
        |      "title": "教育经历",
        |      "titleType": "TEXT",
        |      "child": []
        |    },
        |    {
        |      "title": "技能",
        |      "titleType": "TEXT",
        |      "child": []
        |    },
        |    {
        |      "title": "项目经历",
        |      "titleType": "TEXT",
        |      "child": []
        |    }
        |  ]
        |}""".stripMargin

    val list=BattBean(json)
    val objectMapper = new ObjectMapper() with ScalaObjectMapper
    objectMapper.registerModule(DefaultScalaModule)

    for (a<-list){
      println(objectMapper.writeValueAsString(BattIteratorAnalysis.mYanalysis(null,a)))
    }
  }
}
